
/*
The basic library must provide <LIBNAME>-traits.h file.
*/

#if defined(__CSL_BASE_H__)
	#include "_traits_/CSL-traits.h"
#elif defined(__GKC_DEF_H__)
	#include "_traits_/GKC-traits.h"
#else
	#error def.h requires <LIBNAME>-traits.h to be included first.
#endif

////////////////////////////////////////////////////////////////////////////////

// basic types

/*
The basic library must provide the following types:

int8_t
uint8_t
int16_t
uint16_t
int32_t
uint32_t
int64_t
uint64_t
intptr_t
uintptr_t
char_s
char
*/

// macros

/*
assert
_s
*/

// functions

/*
template <typename T>
inline T&& rv_forward(T& t) noexcept;

template <typename T, typename... Args>
inline void call_constructor(T& t, Args&&... args);

template <typename T>
inline void call_destructor(T& t) noexcept;

inline void thread_sleep(uint32_t tm) noexcept;
*/

////////////////////////////////////////////////////////////////////////////////
namespace CTL {
////////////////////////////////////////////////////////////////////////////////

// operators

/*
template <typename T>
class NumericTraits
	static constexpr const T MinValue
	static constexpr const T MaxValue

template <typename T>
class ArithmeticTraits
	static bool Add(T t1, T t2, T& r) noexcept;
	static bool Multiply(T t1, T t2, T& r) noexcept;
	static T AddThrow(T t1, T t2);
	static T MultiplyThrow(T t1, T t2);

template <typename T>
class NumberTraits
	static T Abs(T t) noexcept;
	static bool IsOdd(T t) noexcept;

template <typename T>
class FloatTraits
	static bool isfinite(T t) noexcept;
	static T acos(T t) noexcept;
	static T acosh(T t) noexcept;
	static T asin(T t) noexcept;
	static T asinh(T t) noexcept;
	static T atan2(T t1, T t2) noexcept;
	static T atanh(T t) noexcept;
	static T cos(T t) noexcept;
	static T cosh(T t) noexcept;
	static T exp(T t) noexcept;
	static T ldexp(T t, int e) noexcept;
	static T log(T t) noexcept;
	static T log10(T t) noexcept;
	static T log2(T t) noexcept;
	static T pow(T t1, T t2) noexcept;
	static T sin(T t) noexcept;
	static T sinh(T t) noexcept;
	static T sqrt(T t) noexcept;
	static T tan(T t) noexcept;
	static T tanh(T t) noexcept;
	static T ceil(T t) noexcept;
	static T floor(T t) noexcept;
	static T round(T t) noexcept;
	static T trunc(T t) noexcept;

template <typename T>
class DefaultCompareTrait

template <class TTrait>
class CompareTraits
	typename ValueType
	typename TraitType
	static bool EQ(const ValueType& t1, const ValueType& t2) noexcept;
	static bool NE(const ValueType& t1, const ValueType& t2) noexcept;
	static bool LT(const ValueType& t1, const ValueType& t2) noexcept;
	static bool LE(const ValueType& t1, const ValueType& t2) noexcept;
	static bool GT(const ValueType& t1, const ValueType& t2) noexcept;
	static bool GE(const ValueType& t1, const ValueType& t2) noexcept;
	static int32_t Compare(const ValueType& t1, const ValueType& t2) noexcept;
*/

// byte order

/*
class ByteOrderTraits
	static bool IsBigEndianHost() noexcept;
	template <typename T>
	static T Swap(T x) noexcept;
*/

// memory

/*
class MemoryTraits
	static void Copy(const void* src, uintptr_t size, void* dest) noexcept;
	static void Move(const void* src, uintptr_t size, void* dest) noexcept;
	static void Zero(void* dest, uintptr_t size) noexcept;
	static void Fill(uint8_t value, void* dest, uintptr_t size) noexcept;
*/

// exceptions

/*
class ExceptionTraits
	static void ThrowInvalid();
	static void ThrowMemory();
	static void ThrowOverflow();
	static void ThrowUnexpected();
*/

// containers

/*
template <class TIterator>
class IteratorTraits
	typename ValueType
	typename IteratorType
	static intptr_t CalcDistance(const IteratorType& begin, const IteratorType& end) noexcept;
	static const ValueType& Get(const IteratorType& it) noexcept;
	static ValueType& Get(IteratorType& it) noexcept;
	static IteratorType Move(const IteratorType& it, intptr_t delta) noexcept;
	static void Move(intptr_t delta, IteratorType& it) noexcept;
	static void ToNext(IteratorType& it) noexcept;
	static void ToPrev(IteratorType& it) noexcept;
	template <class TFunctor>
	static void ForEach(const IteratorType& itb, const IteratorType& ite, const TFunctor& func);

template <typename T>
class ArrayTraits
	typename ValueType
	typename ArrayType
	static uintptr_t GetSize(const ArrayType& arr) noexcept;
	static const ValueType* GetAddress(const ArrayType& arr) noexcept;
	static ValueType* GetAddress(ArrayType& arr) noexcept;
	static const ValueType& GetAt(const ArrayType& arr, uintptr_t index) noexcept;
	static ValueType& GetAt(ArrayType& arr, uintptr_t index) noexcept;
	static void Clear(ArrayType& arr) noexcept;
	static void SetSize(ArrayType& arr, uintptr_t size);
	static void Append(const ValueType& src, ArrayType& arr);
	static void RemoveAt(ArrayType& arr, uintptr_t index) noexcept;
	template <typename... Args>
	static void InsertAt(ArrayType& arr, uintptr_t index, Args&&... args);

template <typename Tchar>
class CharTraits
	typename CharType (char char_s)
	static CharType ToLower(CharType ch) noexcept;
	static CharType ToUpper(CharType ch) noexcept;
	static bool IsAlnum(CharType ch) noexcept;
	static bool IsAlpha(CharType ch) noexcept;
	static bool IsCntrl(CharType ch) noexcept;
	static bool IsGraph(CharType ch) noexcept;
	static bool IsLower(CharType ch) noexcept;
	static bool IsUpper(CharType ch) noexcept;
	static bool IsDigit(CharType ch) noexcept;
	static bool IsXdigit(CharType ch) noexcept;
	static bool IsBlank(CharType ch) noexcept;
	static bool IsSpace(CharType ch) noexcept;
	static bool IsPrint(CharType ch) noexcept;
	static bool IsPunct(CharType ch) noexcept;
	static uintptr_t GetLength(const CharType* sz) noexcept;

template <class TString>
class StringTraits
	typename CharType (char char_s)
	typename StringType
	static uintptr_t GetLength(const StringType& str) noexcept;
	static const CharType* GetAddress(const StringType& str) noexcept;
	static CharType* GetAddress(StringType& str) noexcept;
	static void Clear(StringType& str) noexcept;
	static void Append(CharType ch, StringType& str);
	static void Append(const CharType* sz, StringType& str);
	static void Append(const StringType& src, StringType& str);
*/

////////////////////////////////////////////////////////////////////////////////
}
////////////////////////////////////////////////////////////////////////////////
